package weatherstation;

public class HeatindexDisplay implements Observer, DisplayElement {

    protected Subject weatherData;
    protected float temp;

    public HeatindexDisplay(Subject weatherData) {
        this.weatherData = weatherData;
        weatherData.registerObserver(this);
    }

    @Override
    public void update(float temperature, float humiduty, float pressure) {
        this.temp = temperature * temperature;
        display();
    }

    @Override
    public void display() {
        System.out.println("Heatindex: " + temp);
    }
}
